package ru.vba.pojo;

public class Cell {
	private Coordinate coordinate;
	private Bonus bonus;
	private Point point;
	public Cell(Coordinate coordinate, Bonus bonus, Point point){
		this.coordinate = coordinate;
		this.bonus = bonus;
		this.point = point;
	}
	public int getPosX() {
		return coordinate.getPosX();
	}
	public int getPosY() {
		return coordinate.getPosY();
	}
	public Bonus getBonus() {
		return bonus;
	}
	@Override
	public boolean equals(Object obj) {
		if (!(obj instanceof Cell)){
			throw new IllegalArgumentException();
		}
		Cell cell = (Cell) obj;
		return cell.getPosX() == this.getPosX() && cell.getPosY() == this.getPosY();
	}
	@Override
	public int hashCode() {
		return (this.getPosX() << 2) * (this.getPosY() << 2);
	}
	public Coordinate getCoordinate() {
		return coordinate;
	}
	public Point getPoint() {
		return point;
	}
}
